magick_elementfandomcom-20200214-history
How To Configure
Configuring means to customize the plugin to meet the requirement of one's server, through editing configuration file. This page is written for a server owner or operator, describing the configuration of Magick Element. When you drag the jar of Magick Element into the plugin folder of your server side, and then start or reload the server, a config.yml will be generated. The config.yml is called the default configuration, which is initially developed by the plugin developer. The default configuration reflects developers consideration of both balance and plugin features. It's strongly recommended for you to read the default configuration at first, no matter you just want to make minor change to default configuration, or rewrite the configure itself completely. __TOC__ Prerequisite It would be better to use text editor with grammar highlight than a common text editor if you want to edit its configuration, like: *vim *emacs *gedit *sublimes *notepad++ You should have experience of editing configuration of other plugin, using yaml file. The yaml package in bukkit is snakeyml. You should use two spaces instead of one tab when editing yaml file, do not forget to backup your previous configuration before you make any change, especially when the configuration itself is rather large. Structure The plugin itself is currently made up of 6 major modules: *''book'' *''cauldron'' *''element'' *''handler'' *''spell'' *''buff'' Every module needs a module factory class or a module class (called the class entry), except for the element and spell module. The class entry is currently using the full name of the class. And there's no exception that every module is mapped to a config section. If you use text editor that supports collapsing (like notepad++), and you use collapse any substructure of the yaml, you will see there lay class entries and config sections for these major modules. And we provides a list of them: Book Book configurations are related to how the plugin craft and recognize a magick book. Players right click on a magick book to use magick, so there should be some way to recognize it. The default method is adding an identifier page (with a initially random generated string, can be customized) to the book, any written book contains this identifier page will be a magick book. And we use net.aegistudio.magick.book.PagingBookFactory as the class entry. There're other ways to recognize a book, such as adding lore, adding potion effect, and even the combination of them. So have a look at the book category if you want to customize. Be caution when modifying the class entry and config section of book. It may cause former crafted magick book to lose power, which may cause player umbrage. And the book section should be modified as early as possible, keeping it invariant in game play. Cauldron Cauldron configurations are related to using cauldron to hold and craft items. Player right click on a cauldron to open it, set a fire under the cauldron to begin forging, and take crafted magick book after being forged. The class entry of cauldron could only be net.aegistudio.magick.cauldron.MagickCauldronFactory currently. However, the capacity, the time taken to forge, and the display text can be customized. Customizing the capacity will may cause the saved inventory of cauldron lost, so a backup of cauldron.inv under the plugin data folder may be essential. Element Element configuration reveals what kinds of elements and how much elements are there in a specific item. :: factor: : ... [:] (<> surrounded text referes to the content of this tag, and [] surrounded text means inner text is optional.) No predefining of any element is required. Which means if you want to add an element called crimson, you just need to specify it under factor section of some item, without predefining it. It should be mentioned that when damage value of the item to match is not set, an item with any damage value will be matched. Which means POTION matches water bottle and any potion. And you can specify both id-only and id-damage key, like POTION:0 and POTION. And the water bottle will match POTION:0, other potions will match POTION. When it comes to target, the damage of an target not set will cause the output product keeps the same damage value with the input item. Only items whose element value inside is taken will be transformed. Handler Handler configuration is related to how the player can use magick. The player may consume mana power (MP) to use magick, or chant for a while to use it. The default handler is net.aegistudio.magick.chant.MpSpellHandler. Where MP will be consumed if a player uses magick. And setting the hander to net.aegistudio.magick.chant.ChantSpellHandler will require a player to chant instead of using MP. Remember to remove the config section to initialize data. Spell Spell is the most complicated section. It specifies what spells could be written in a magick book. A spell consists of the spell name, the effect, the description and the handler info. And the spell is definied as follow: : effectClass: effectConfig: ... elementRequired: : ... description: : The effect tells what the spell actually do. Like adding buff to its user, spawning lightning bolts around the player, etc. Like the major modules, the effect needs a class entry (effectClass) and a config section (effectConfig) to be configured. A spell consumes some element to be empowered, and the element cost is defined in the elementRequired entry. The elements inside also need not to be predefined, however this may cause a spell unable to be empowered. Description provides information about this spell, and the player can only infer what this spell can do through spell name and description. Handler info provides price for using this spell. Like mpCost is needed for MP-consuming magicks, and chantingTime is required for chanting magicks. If this section is not provided, a price will be calculated and written after the spell, which is based on the element requirement. Buff Buff is related to how the plugin can display a buff. The default class entry for this module is net.aegistudio.magick.buff.ScoreboardBuffManager, which displays the buff and remaining time on the scoreboard. You can set it to net.aegistudio.magick.buff.MutedBuffManager and nothing about the spell will be displayed to the player. Category:Tutorial